﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;

namespace Deployment.Data.UI.Controls
{
    public class MyScrollViewer :ScrollViewer 
    {
        static MyScrollViewer(){
            ContentProperty.OverrideMetadata(typeof(MyScrollViewer),
                new FrameworkPropertyMetadata(
                    new PropertyChangedCallback(OnContentChanged)));

        }

 

    private static void OnContentChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    {
        MyScrollViewer mcc = d as MyScrollViewer;
        if (mcc.ContentChanged != null)
        {

            DependencyPropertyChangedEventArgs args
                = new DependencyPropertyChangedEventArgs(ContentProperty, e.OldValue, e.NewValue);
            mcc.ContentChanged(mcc, args);
        }
    }

 

    public event DependencyPropertyChangedEventHandler ContentChanged;
    }
}
